﻿using Basic.HrRemoteModel.Dept;
using Basic.HrRemoteModel.Dept.Model;
using Basic.HrRemoteModel.Unit;
using Basic.HrRemoteModel.Unit.Model;
using WeDonekRpc.Client.Attr;

namespace Basic.FormExtendService.lmpl
{
    [ClassLifetimeAttr(ClassLifetimeType.SingleInstance)]
    internal class UnitDeptService : IUnitDeptService
    {
        public long[] FindDeptId ( DeptFindParam param )
        {
            return new FindDeptId
            {
                Param = param,
            }.Send();
        }

        public Dictionary<long, string> GetNames ( long[] ids )
        {
            return new GetDeptNames
            {
                Ids = ids
            }.Send();
        }

        public DeptTree[] GetTrees ( DeptGetArg arg )
        {
            return new GetDeptTree
            {
                Param = arg
            }.Send();
        }

        public Dictionary<long, string> GetUnitDeptName ( long[] ids )
        {
            return new GetUnitDeptNames
            {
                Ids = ids
            }.Send();
        }

        public DeptTree[] GetUnitDeptTree ( UnitGetArg param )
        {
            return new GetUnitDeptTree
            {
                Param = param
            }.Send();
        }
    }
}
